<?php if(isset($_SESSION['admin'])){?>
<?php $header=$this->action('Application\Controller\IndexController', 'headerAction',array('20','10'));
	  $baseUrl = $header->headerarray['baseUrl'];
	  $basePath = $header->headerarray['basePath'];
	  $paypalUrl = $header->headerarray['paypalUrl'];
	  $paypalid = $header->headerarray['paypalid'];
?>
<div class="container">
	<div class="well"> 
		 <ul class="login-form-sec">
				<form action="<?php echo $paypalUrl;?>" method="post" id="paypal-payment-form" accept-charset="UTF-8">  
					<input type="hidden" name="cmd" value="_xclick">
					<input type="hidden" name="business" value="<?php echo $paypalid;?>">
					<input type="hidden" name="amount" id="amount" value="<?php echo $_SESSION['orders']['total_amount']; ?>">
					<input type="hidden" name="custom" value="1"/>			
					<input type="hidden" name="no_note" value="1">
					<input type="hidden" name="currency_code" value="USD">
					<input type="hidden" name="item_name" value="Ads posting">
					<input type="hidden" name="item_number" value="<? echo $_GET['order_id'];?>" />
					<input type="hidden" name="tx" value="<? echo $_GET['order_id'];?>" />
					<input type="hidden" name="order_id" value="<? echo $_GET['order_id'];?>" />
					<input type="hidden" name="return" value="<?php echo $baseUrl; ?>admin/payment-success">
					<input type="hidden" name="cancel_return" value="<?php echo $baseUrl; ?>admin/payments?order_id=<? echo $_GET['order_id'];?>">
					<input type="hidden" name="rm" value="2">
					<!--<input  class="pay_r_sub" type="submit" value="continue">-->
				</form>
		  </ul>
	</div>
</div>
<script>
	alert("Please wait redirecting to pay pay site");
		$("#paypal-payment-form").submit();	
</script>
<?php }else{?>
<script>
	window.location=ADMIN_BASE_URL+admin;
</script>
<?php } ?>